<template>
  <div class="signin">
    <div class="sign-body">
      <scalebox>
        <view>
          <van-button
            icon="replay"
            type="default"
            size="small"
          >重新定位</van-button>
        </view>
        <template slot="mark">
          <div class="sign-body-location">
            <van-icon name="location-o" />
            {{location}}
          </div>
        </template>
      </scalebox>
      <div
        class="sign-body-circle sign-body-circle-no"
        v-if="status == 0"
      >
        未签到
      </div>
      <div
        class="sign-body-circle sign-body-circle-yes"
        v-else
      >
        已签到
      </div>
      <div class="sign-body-location">
        <van-icon name="location-o" />
        {{location}}
      </div>
    </div>
    <div
      class="sign-body-info-reset"
      @click="resetLocation"
    >
      <van-button
        icon="replay"
        type="default"
        size="small"
      >重新定位</van-button>
    </div>
  </div>
</template>

<script>
import Scalebox from '@/components/scalebox'
export default {
  components: {
    Scalebox
  },
  props: {
    status: {
      type: Number,
      default: 0
    },
    location: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      // location: '签到区域：奥体中心体育场北广场'
    }
  },
  onShow () {
    this.onLoadData()
  },
  methods: {
    onLoadData () {
    },
    resetLocation () {
      wx.showToast({
        title: '定位失败',
        icon: 'none',
        duration: 3500
      })
      this.$emit('resetloc', 'xxxxxxx')
    }
  }
}
</script>

<style lang="less">
.signin {
  height: calc(100vh - 52px);
  position: relative;
  display: flex;
  flex-direction: column;
}
@grey: #666;
@red: red;
.sign-body {
  height: 100%;
  overflow: hidden;
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  &-circle {
    margin: 10px auto;
    text-align: center;
    width: 120px;
    height: 120px;
    line-height: 120px;
    border-radius: 60px;
    border: 5px solid #fff;
    font-size: 16px;
    color: #fff;
    &-yes {
      background-color: #ee732f;
    }
    &-no {
      background-color: #e2976f;
    }
  }
  &-location {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 20px 0px 10px 0px;
  }
}
.sign-body-info-reset {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grey {
  color: @grey;
}
.red {
  color: @red;
}
</style>
